export default {
	data() {
		return {
			//设置默认的分享参数
			share: {
				title: '朝读经典德育学本',
				path: '/pages/chapters/chapters',
				imageUrl: '',
				desc: '',
				content: ''
			}
		}
	},
 
	onShareAppMessage(res) {
		let that = this
		return {
			title: that.share.title,
			path: that.share.path,
			imageUrl: that.share.imageUrl,
			desc: that.share.desc,
			content: that.share.content,
			success(res) {
				uni.showToast({
					title: '分享成功',
					//icon: 'none'
				})
			},
			fail(res) {
				uni.showToast({
					title: '分享失败',
					icon: 'none'
				})
			}
		}
	},
 
	onShareTimeline(res) {
		let that = this
		let data = {
			title: that.share.title,
			imageUrl: that.share.imageUrl,
			path: that.share.path,
			success: res => {
				uni.showToast({
					title: '分享成功',
						//icon: 'none'
				})
				// 分享成功
				//if (res.errMsg == 'shareAppMessage:ok') {}
			},
			fail: res => {
				uni.showToast({
					title: '分享失败',
					icon: 'none'
				})
				
				// ⽤户取消
				//if (res.errMsg == 'shareAppMessage:fail cancel') {}
				// 分享失败
				//if (res.errMsg == 'shareAppMessage:fail') {}
			},
			complete: res => {}
		}
		return data
	}
 
	 
}
